//
//  KRFindCarouselModel.m
//  KEREN
//
//  Created by MW on 2023/4/24.
//

#import "KRFindCarouselModel.h"

@implementation KRFindCarouselModel

+ (instancetype)initWithDictionary:(NSDictionary *)jsonDic{
    KRFindCarouselModel *model = [[super alloc] init];
    [model setValuesForKeysWithDictionary:jsonDic];
    if(model.image_url){
        if(![model.image_url hasPrefix:@"http"]){
            model.image_url = [NSString stringWithFormat:@"%@%@",BaseimageUrl,model.image_url];
        }
    }
    model.image_url = [ model.image_url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    return model;
}

-(id)valueForUndefinedKey:(NSString *)key
{
    return nil;
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if([key isEqualToString:@"id"]){
        self.Id  = [value intValue];
    }
    if([key isEqualToString:@"ID"]){
        self.Id  = [value intValue];
    }
    
}

@end
